package com.wangyadong.hobby.common.utils.email;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @ClassName EmailEventUtils
 * @Description TODO
 * @Authpr Antonio
 * @Data 2018-07-14 12:07
 */
public class EmailEventUtils {


    public static void send(Runnable runnable) {
        ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
        executorService.execute(runnable);
        executorService.shutdown();
    }

    public static void main(String[] args) {

        ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                System.out.println("==========");
            }
        };
        executorService.execute(runnable);
        executorService.shutdown();
    }
}
